package api

import (
	"sieve_admin_server_userpass/pkg/im3/chatmsg"
	"sieve_admin_server_userpass/pkg/json"
)

func SendSysMsgToUsers(uids []int, name string, msg *chatmsg.Msg) error {
	j1, err := json.Marshal(uids)
	if err != nil {
		return err
	}
	j2, err := json.Marshal(&msg)
	if err != nil {
		return err
	}
	_, err = reqApi("send_sysmsg_to_user", map[string]string{
		"uids": string(j1),
		"name": name,
		"data": string(j2),
	})
	return err
}
